﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITS.Core.Domain.Users;
using ITS.Core.ViewModel.Users;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace ITS.Core.ViewModel.Users
{
    public class CreateUserViewModel
    {
        public Guid UserID { get; set; }

        [Required]
        public string Username { get; set; }

        [Required]
        [MaxLength(20, ErrorMessage = "The maximum length of the password is 20")]
        [MinLength(6, ErrorMessage = "The minimum length of the password is 6")]
        public string Password { get; set; }
        [Compare("Password", ErrorMessage = "Passwords must match")]
        public string Password2 { get; set; }

        public string Description {get;set;}
        [Required, RegularExpression(@"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
				[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
				[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$", ErrorMessage = "Invalid email")]
        public string Email { get; set; }
        [Required]
        public string DisplayName { get; set; }
        public string Website { get; set; }

        public IList<SelectRoleModel> SelectRoleModels { get; set; }
    }
}
